package edu.pku.hawk.controller.util;

import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;

public class Constants implements Serializable {

	/*
	 * Message queue config
	 */
	private static String JMS_Address = PropertiesUtil.getInstance().readValue(PropertiesUtil.JMS_SERVER);
	public static String MQServer_Name = "";
	public static String MQServer_Password = "";
	public static String MQServer_URL = "failover://tcp://"+JMS_Address+":61616";
	//public static String MQServer_URL = "failover://tcp://172.16.0.67:61616";
	public static boolean PrintLog = true;

	/*
	 * Data source
	 */
	public static String DataSource_Name = "soauser";
	public static String DataSource_Password = "123456";
	public static String DataSource_URL = "192.168.0.164:3306";
	public static String DataSource_DB = "demo";
	public static boolean DataSource_Using = true;

	/*
	 * RFID
	 */
	public static String RFID_Name = "root";
	public static String RFID_Password = "root";
	public static String RFID_URL = "192.168.0.149";
	public static String RFID_DB = "demo";
	public static boolean RFID_Using = false;
	
	/*
	 * File path
	 */
	public static String Battlefield_File_Path = "config/battlefield.txt";
	public static String Service_Resource_File_Path = "config/serviceprofile.txt";
	public static final String Properties_File_Path = "config/config.properties";
	public static final String Config_Folder_Path = "config/";
	public static String Device_File_Path = "config/device.txt";

	/* 
	 * web service
	 */
	public static String SensorDataSer_URL = "//172.16.0.65:9000/SensorDataService";
	
	public static int Battlefield_Width = 300;
	public static int Battlefield_Height = 400;

	public static double Battlefield_Radio = 1;
	
	public static int Infrared_Outer_ID = 1;
	public static int Infrared_Inner_ID = 2;

	static {
		// Load config
		// Config.Singleton.Instance.initialize();
	}
	/*
	 * Message queue name
	 */
	public static final String Ctrl_UI_Sensor_QueueName = "CtrlUISensorQueue";
	public static final String Ctrl_UI_Path_QueueName = "CtrlUIPathQueue";
	public static final String Ctrl_UI_Proc_QueueName = "CtrlUIProcQueue";
	public static final String Ctrl_UI_Battlefield_QueueName = "CtrlUIBattlefieldQueue";
	public static final String Ctrl_UI_ServiceProfile_QueueName = "CtrlUIServiceProfile_Queue";

	public static final String Ctrl_UI_ClearSandRequest_QueueName = "CtrlUIClearSandRequestQueue";
	public static final String Ctrl_UI_ClearSandResponse_QueueName = "CtrlUIClearSandResponseQueue";
	public static final String Ctrl_UI_ProcConfirm_QueueName = "CtrlUIProcConfirmQueue";
	public static final String Ctrl_Cloud_RscRequest_QueueName = "CtrlCloudRscReauestQueue";
	public static final String Ctrl_Cloud_RscRequest_UI_QueueName = "CtrlCloudRscReauestUIQueue";
	public static final String Ctrl_Cloud_RscResponse_QueueName = "CtrlCloudRscResponseQueue";
	public static final String Ctrl_Cloud_RscResponse_UI_QueueName = "CtrlCloudRscResponseUIQueue";

	public static final String Cmd_ClearSand_Request = "CmdClearSandRequest";
	public static final String Cmd_ClearSand_Response = "CmdClearSandResponse";

	public static final String Ctrl_UI_Alarm_QueueName = "CtrlUIAlarmQueueName";
	
	// public static final String Infrared_ROW_QueueName = "InfraredRowQueue";
	// public static final String Smoke_ROW_QueueName = "SmokeRowQueue";
	// public static final String Pressure_ROW_QueueName = "PressureRowQueue";
	// public static final String Sound_ROW_QueueName = "SoundRowQueue";
	// public static final String Metal_ROW_QueueName = "MetalRowQueue";
	// public static final String Figure_ROW_QueueName = "FigureRowQueue";
	//
	// public static final String Infrared_Monitor_Client_QueueName =
	// "InfraredMonitorClientQueue";
	// public static final String Smoke_Monitor_Client_QueueName =
	// "SmokeMonitorClientQueue";
	// public static final String Pressure_Monitor_Client_QueueName =
	// "PressureMonitorClientQueue";
	// public static final String Sound_Monitor_Client_QueueName =
	// "SoundMonitorClientQueue";
	// public static final String Metal_Monitor_Client_QueueName =
	// "MetalMonitorClientQueue";
	// public static final String Figure_Monitor_Client_QueueName =
	// "FigureMonitorClientQueue";
	//
	// public static final String Infrared_Monitor_Process_QueueName =
	// "InfraredMonitorProcessQueue";
	// public static final String Smoke_Monitor_Process_QueueName =
	// "SmokeMonitorProcessQueue";
	// public static final String Pressure_Monitor_Process_QueueName =
	// "PressureMonitorProcessQueue";
	// public static final String Sound_Monitor_Process_QueueName =
	// "SoundMonitorProcessQueue";
	// public static final String Metal_Monitor_Process_QueueName =
	// "MetalMonitorProcessQueue";
	// public static final String Figure_Monitor_Process_QueueName =
	// "FigureMonitorProcessQueue";

	// public static final String ListenAvailable_Process_Monitor_QueueName =
	// "ListenAvailableProcessMonitorQueue";

	// public static final String ProcessAvailable_True =
	// "ProcessAvailableTrue";
	public static final String ProcessAvailable_False = "ProcessAvailableFalse";

	/*
	 * DB table name
	 */
	public static final String Infrared_TableName = "sensor_infrared";
	public static final String Fog_TableName = "sensor_smoke";
	public static final String Pressure_TableName = "sensor_pressure";
	public static final String Sound_TableName = "sensor_sound";
	public static final String Metal_TableName = "sensor_metal";
	public static final String RFID_TableName = "sensor_rfid";
	public static final String Vibrate_TableName = "sensor_vibrate";

	

	/*
	 * Service full name
	 */
	public static final String Infrared_Ser = "Infrared";
	public static final String Fog_Ser = "Smoke";
	public static final String Pressure_Ser = "Pressure";
	public static final String Sound_Ser = "Sound";
	public static final String Metal_Ser = "Metal";
	public static final String RFID_Ser = "RFID";
	public static final String Combination_Ser = "Combination";

	/*
	 * UI sensor type
	 */
	public static final int TYPE_UNKNOWN = -1;
	public static final int TYPE_PRESSURE_SENSOR = 1;
	public static final int TYPE_SOUND_SENSOR = 2;
	public static final int TYPE_FOG_SENSOR = 3;
	public static final int TYPE_INFRARED_SENSOR = 4;
	public static final int TYPE_VEDIO_SENSOR = 5;
	public static final int TYPE_RFID_SENSOR = 10;
	public static final int TYPE_METAL_SENSOR = 9;
	public static final int TYPE_VIBRATE_SENSOR=14;
	
	public static final int TYPE_INVADE = 200;
	public static final int TYPE_RETREAT = 201;
	
	//new service type
	public static final int TYPE_TRACK = 11;
	public static final int TYPE_IDENTIFY=13;
	
	
	public static final int TYPE_TRACE_TANK = 100;
	public static final int TYPE_TRACE_TRUNK = 101;

	public static final String Infrared_Short_name = "I";
	public static final String Pressure_Short_name = "P";
	public static final String Sound_Short_name = "S";
	public static final String Metal_Short_name = "M";
	public static final String Vedio_Short_name = "E";
	public static final String Fog_Short_name = "F";
	public static final String Battlefield_Short_name = "Z";
	public static final String RFID_Short_name = "R";
	public static final String Vibrate_Short_name = "V";
	public static final String BPressure_Short_name = "B";

	public static String RFID_NUM_OUR_TANK = "AECCFGGGF";
	public static String RFID_NUM_UNKNOWN = "WRETRTTRF";

	public static String RFID_DES_OUR_TANK = "TANK 145A6 FOUND";

	public static String head() {
		Date date = new Date();
		return "[Controller " + date.toLocaleString() + "]  ";
	};

	/*
	 * Controller sensor type
	 */
	public enum DetectorType implements Serializable {
		infrared, pressure, sound, fog, metal, video
	}

	public enum DetectorState implements Serializable {
		alarm, normal, suspect, offline
	}

	public enum ServiceAccessMode implements Serializable {
		LocalDBService, FakeDBService, DistributedCloud
	}
	
	public enum FusionMode implements Serializable {
		LocalSer, DistributedCloud
	}
	
	public enum FusionAlgorithm implements Serializable {
		Average, MatlabEmulation, Probability1, Probability2,
	}

	public static void main(String[] str) {

		HashMap<Integer, String> hash = new HashMap<Integer, String>();

		hash.put(Integer.valueOf("9"), "asdf");
		System.out.println(hash.get(9));

	}
}
